Boundary SPH
Boundary SPH for Robust Particle-Mesh Interaction in Three Dimensions
Smoothed Particle Hydrodynamics (SPH) is a well-established method for simulating weakly or non-compressible fluids. Its particle physics are driven by Navier-Stokes equations, which are commonly used to model pressure forces between particles. SPH relies on the idea of identifying neighbor particles for each particle, determining the overall pressure forces applied to said particles based on qualities such as mass, density, and temperature, and then enacting those forces in discrete timesteps. It’s difficult to conduct SPH simulations on the CPU, however - imagine trying to replicate these steps for thousands, maybe millions, of individual particles. The overhead alone will lag the simulation significantly. To solve this, parallelization scemes are required. If you’re using a game engine like Unity, then your likely solution would be to use HLSL compute shaders to drive GPU operations.
There are some issues with particle systems like SPH. Namely, they treat particles as point masses, which prevents rigidbody mesh-based collisions with meshed objects. If driven by parallelization using a GPU, then another bottleneck is in the communication between the CPU and GPU. I wanted to see if we could solve this by moving mesh data from the CPU to the GPU and using signed distance calculations and voronoi region logic to measure the intersection of particles with mesh surfaces.
Goals
This project effectively is an exploration of whether this method is not only possible but efficient in terms of FPS. If this method was achievable, then we could replicate mesh transformations by simply converting Unity matrix transformations from the CPU to the GPU, then conduct mesh transformations via matrix operations. My method - which I refer to as “boundary SPH” (BSPH) - successfully accomplishes these ideas. I have some samples below that demonstrate these. Keep in mind - these also include early implementations!
For full disclosure, I wasn’t exactly familiar with particle simulation before this project. This was my first project where I had to handle parallelization schemes for large-scale particle simulations. And in Unity no less! Terrifying, to be sure. I first started this project as a collaborative measure to model realistic physics of underwater phenomena (i.e. underwater currents, pressure) in interaction with simulated underwater robots. When our collaborator left, I ended up taking over the project.
Download the report here: Download Manuscript PDF (18.0 mB)

- Kim, R., & Torrens, P. M. (2024). Boundary sph for robust particle-mesh interaction in three dimensions. Algorithms, 17(5). URL: https://www.mdpi.com/1999-4893/17/5/218, doi:10.3390/a17050218
- Full PaperBibtexGithub Repo